package org.jeecg.modules.basic.entry.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.basic.demo.student.entity.LwgyBaseStudent;
import org.jeecg.modules.basic.entry.entity.Apartment;
import org.jeecg.modules.basic.entry.entity.LwgyFjInout;
import org.jeecg.modules.basic.entry.entity.LwgyInoutRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.basic.entry.entity.LwgyStudentInout;


import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * @Description: 出入管理
 * @Author: jeecg-boot
 * @Date:   2020-12-04
 * @Version: V1.0
 */
public interface ILwgyInoutRecordService extends IService<LwgyInoutRecord> {


    /** 查询学生在寝状态 */
    IPage<LwgyStudentInout> stuPageList(Page<LwgyStudentInout> page, QueryWrapper<LwgyStudentInout> queryWrapper);

    List<LwgyStudentInout >outStuPageList();
    //通过学号获取学生信息，不关联床位信息
    LwgyBaseStudent queryStuByNumString(String studentNumber);

    //通过学生id和进出状态，判断房间通断状态及进行通断电
    Boolean stuBindPower(String stuId,String direction, List<Map<String, String>> stuFj);

    //通过学生id获取宿舍房间号及房间roomid
    List<Map<String, String>> getStudentFjById(String roomId);

    //通过学生id获取宿舍中所有学生最近的进出情况
    List<Map<String, String>> roommateInout(String roomId);

    //人来开电人走断电，跟学生住宿无关，演示用
    Boolean stuBindPowerTest(String direction);

    IPage<LwgyFjInout> totalPage(Page page, QueryWrapper queryWrapper);
    //掉接口开关电
    void powerController(LwgyInoutRecord lwgyInoutRecord);
    //写入apartment表，用领导程序开关电
    void powerInApartment(LwgyInoutRecord lwgyInoutRecord) throws ParseException;
    List<Apartment> selectList(String xq,String lh,String fjh,String state,String count);
    //在寝室人数统计（按楼宇）
    List<Map<String, String>> StaOfDormitoryPopulationByBuilding(String id);
    //在寝室人数统计（按学院）
    List<Map<String, String>> StaOfDormitoryPopulationByCollege(String id);

}
